-
-
Notifications
You must be signed in to change notification settings - Fork 112
[Slider] Fix overlapping slider thumbs stuck at min or max #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Slider] Fix overlapping slider thumbs stuck at min or max #1732
Conversation
@@ -129,8 +129,6 @@ export function useSliderThumb(parameters: useSliderThumb.Parameters): useSlider | |||
}[orientation]]: `${percent}%`, | |||
[isVertical ? 'left' : 'top']: '50%', | |||
transform: `translate(${(isVertical || !isRtl ? -1 : 1) * 50}%, ${(isVertical ? 1 : -1) * 50}%)`, | |||
// So the non active thumb doesn't show its label on hover. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only relevant to ValueLabel
from @mui/base
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
649074a
to
0f4c023
Compare
I think whichever one was used last should be the one that's on top? e.g. I'd expect max to be on top here but it flips to the min Screen.Recording.2025-04-17.at.9.44.33.am.mov |
Actually assuming all the thumbs have equal z-index, it seems better to consider the right-most thumb (closest to slider-overlap.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also work fine with RTL right?
Yep ~ here it's only comparing values vs each other and min/max so direction and orientation don't matter |
Fixes #1731
Demo: https://codesandbox.io/p/sandbox/fast-glitter-7tck3z
When 2 or more thumbs overlap in the same position they can be dragged apart now